﻿using MES.Core;
using MES.Model.System;
using MES.Service.System.User;
using Microsoft.AspNetCore.Mvc;

namespace MES.API.Controllers.System
{
    /// <summary>
    /// 用户管理
    /// </summary>
    [ApiVersion("1.0", Deprecated = false)]
    [Route("api/[controller]/[Action]")]
    [ApiController]
    public class UserController : ControllerBase
    {
        private readonly IUserService _userService;

        public UserController(IUserService userService)
        {
            _userService = userService;
        }

        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<OperateResult> AddUserAsync([FromBody] Sys_User user)
        {
            return await _userService.AddUserAsync(user);
        }
    }
}
